<template>
  <div class="u-p-20">
    <el-card shadow="never">
      <div slot="header">
        <b class="u-f-16">
          <span v-if="objForm.id">编辑</span>
          <span v-else>添加</span>内容导航
        </b>
        <div class="u-right u-5mt">
          <el-button
            type="success"
            size="small"
            icon="el-icon-document-checked"
            @click="submitForm('objForm')"
            >提交保存</el-button
          >
          <el-button size="small" icon="el-icon-back" @click="$router.go(-1)"
            >返回</el-button
          >
        </div>
      </div>
      <el-form
        :model="objForm"
        :rules="rules"
        ref="objForm"
        label-width="100px"
        class="u-form"
      >
        <el-form-item label="名称" prop="name">
          <el-input
            v-model="objForm.name"
            placeholder="请输入名称"
            maxlength="30"
            show-word-limit
          ></el-input>
        </el-form-item>
        <el-form-item label="类型" prop="type">
          <el-radio v-model="objForm.type" :label="1">图文</el-radio>
          <el-radio v-model="objForm.type" :label="2">视频</el-radio>
        </el-form-item>
        <el-form-item label="排序">
          <el-input
            v-model="objForm.sort"
            placeholder="数字越大权重越高"
          ></el-input>
        </el-form-item>
      </el-form>
    </el-card>
  </div>
</template>

<script>
import commonEdit from "@/mixins/common-edit";
export default {
  mixins: [commonEdit],
  data() {
    return {
      apiName: "contentType",
      backRoute: "contentTypeIndex",
      fileList: [],
      objForm: {
        id: "",
        name: "",
        type: 1,
        parent_id: 0,
        sort: 0,
        status: 1,
      },
    };
  },
  methods: {
    afterGetInfo() {},
  },
};
</script>
